﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Index.aspx.cs" Inherits="Violation_Index" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <link href="../css/Site.css" rel="stylesheet" type="text/css" />
     <link href="../css/smoothness/jquery-ui-1.8.2.custom.css" rel="stylesheet" type="text/css" />
</head>
<body>
    <form id="form1" runat="server">
    <div style="padding: 4px; margin: 5px;">
    <fieldset>
    <legend>搜索</legend>
        <table>
            <tr>
                <td align="right">
                    公司、违规者姓名或违规者证件号：
                </td>
                <td>
                    <asp:TextBox ID="txtKeyWord" runat="server"></asp:TextBox>
                </td>
            </tr>
            <tr>
                <td align="right">
                    输入提交时间起始：
                </td>
                <td>
                    <asp:TextBox ID="txtSearchDate" runat="server"></asp:TextBox>
                </td>
            </tr>
            <tr>
                <td align="right">
                </td>
                <td>
                    <asp:Button ID="btnSearch" runat="server" Text="搜索" OnClick="btnSearch_Click" />
                </td>
            </tr>
        </table></fieldset>
    </div>
    <div>
    </div>
        <asp:GridView ID="gvViolation" runat="server" AllowPaging="True" AutoGenerateColumns="False"
            DataKeyNames="ID" CellPadding="4" ForeColor="#333333" GridLines="None" OnPageIndexChanging="gvViolation_PageIndexChanging"
             Style="width: 100%; text-align:center;" PageSize="10" OnRowCommand="gvViolation_RowCommand" OnRowDeleting="gvViolation_RowDeleting" EmptyDataText="暂时没有数据"
            OnRowEditing="gvViolation_RowEditing" OnSelectedIndexChanged="gvViolation_SelectedIndexChanged">
            <RowStyle BackColor="#EFF3FB" />
            <Columns>
                <asp:TemplateField ShowHeader="False">
                    <ItemTemplate>
                        <asp:HiddenField ID="hID" runat="server" Value='<%# Eval("ID") %>' />
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField ShowHeader="False">
                    <ItemTemplate>
                        <asp:HiddenField ID="hUserID" runat="server" Value='<%# Eval("UserID") %>' />
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField ShowHeader="False">
                    <ItemTemplate>
                        <asp:HiddenField ID="hCompanyID" runat="server" Value='<%# Eval("CompanyID") %>' />
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:BoundField DataField="UserName" HeaderText="姓名" SortExpression="UserName" />
                <asp:BoundField DataField="CompanyName" HeaderText="单位" SortExpression="CompanyName" />
                <asp:BoundField DataField="NoticeNo" HeaderText="违章通知单号码" SortExpression="NoticeNo" />
                <asp:BoundField DataField="ViolationDate" HeaderText="违章时间" SortExpression="ViolationDate" />
                <asp:BoundField DataField="Address" HeaderText="地点" SortExpression="Address" />
                <asp:BoundField DataField="Details" HeaderText="事情经过" SortExpression="Details" />
                <asp:BoundField DataField="CommitterName" HeaderText="记录人" SortExpression="CommitterName" />
                <asp:BoundField DataField="CommitDate" HeaderText="记录时间" SortExpression="CommitDate" />
                <asp:CommandField HeaderText="操作" ShowDeleteButton="True" ShowEditButton="True" ShowHeader="True" />
                <asp:TemplateField HeaderText="操作" Visible="False">
                    <ItemTemplate>
                        <asp:LinkButton ID="btnDeduct" runat="server" CommandName="Deduct" CommandArgument='<%#Eval("UserID")+"|"+Eval("ID") %>'
                            Text="扣分" />
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText=" ">
                    <ItemTemplate>
                        <asp:LinkButton ID="btnDeductList" runat="server" CommandName="DeductList" CommandArgument='<%#Eval("ID") %>'
                            Text="查看相关扣分" />
                    </ItemTemplate>
                </asp:TemplateField>
            </Columns>
            <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
            <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
            <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
            <HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
            <EditRowStyle BackColor="#2461BF" />
            <AlternatingRowStyle BackColor="White" />
        </asp:GridView>
    </form>
</body>
<script src="../script/jquery-1.4.2.min.js" type="text/javascript"></script>

<script src="../script/jquery-ui-1.8.2.custom.min.js" type="text/javascript"></script>

<script>
    $(function () {
        $('#txtSearchDate').datepicker({ dateFormat: "yy-mm-dd" });
    });
</script>
</html>
